#include<stdlib.h>
#include<stdio.h>
#include<string.h>

void * func(int *p){

    p = malloc(sizeof(int)*10);
    for (size_t i = 0; i < 10; i++)
    {
       *(p+i) = i;
    }
    
    return p;
}

int main(int argc,char argv[]){

   
    int *p = NULL;
    p = func(p);
    for (size_t i = 0; i < 10; i++)
    {
        printf(" p[%d] = %d \n",(int)i,*(p+i));
    }
    free(p);
    p = NULL;

    char *str1="hello";
    char *str2=malloc(sizeof(char)*10);
    char str3[10] = "";
    strcpy(str2,"world");
    strcpy(str3,"jack");
    printf(" %s \n",str2);
    printf(" %s \n",str3);
    free(str2);
    str2 = NULL;


   return 0;
}